package com.sinkdream.cms.service.serviceimpl;

import com.sinkdream.cms.dao.FavoriteRelationMapper;
import com.sinkdream.cms.dao.NewsMapper_one;
import com.sinkdream.cms.model.FavoriteRelation;
import com.sinkdream.cms.model.News_one;
import com.sinkdream.cms.service.NewsService_one;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


@Service
public class NewServiceImpl_one implements NewsService_one {
    @Autowired
    private NewsMapper_one newsMapper;
    @Autowired
    private FavoriteRelationMapper relationMapper;

    public void insertitlenews(News_one news) {
        newsMapper.insertitlenews(news);
    }
    @Override
    public List<News_one> selectbytype_page(Map<String, Object> map) {
        return newsMapper.selectbytype_page(map);

    }

    public List<News_one> selectbytype_page_like(Map<String, Object> map) {
        return newsMapper.selectbytype_page_like(map);

    }
    @Override
    public List<News_one> selectbynews_id(int news_id) {
        return  newsMapper.selectbynews_id(news_id);
    }

    @Override
    public List<FavoriteRelation> selectshoucang(FavoriteRelation fale) {
        return relationMapper.selectshoucang(fale);
    }

    @Override
    public void insertZ(FavoriteRelation resa) {
        relationMapper.insertZ(resa);
    }

    @Override
    public void updatezandesc(int news_id) {
        relationMapper.updatezandesc(news_id);
    }

    @Override
    public void updatezan( int news_id) {
        relationMapper.updatezan(news_id);
    }

    @Override
    public void updateByuserandnews(FavoriteRelation resa) {
        relationMapper.updateByuserandnews(resa);
    }

}
